package com.heima.controller;

import com.heima.pojo.JobOption;
import com.heima.pojo.Result;
import com.heima.service.ReportService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;
import java.util.Map;

@RequestMapping("/report")
@RestController
public class ReportController {
    @Autowired
    private ReportService reportService;

    /**
     * 统计各个职位人数
     * @return
     */
    @GetMapping("/empJobData")
    public Result getEmpJobData(){
        JobOption jobOption=reportService.getEmpJobData();
        return Result.success(jobOption);
    }
    @GetMapping("/empGenderData")
    public Result getSexData(){
//        System.out.println("我要给性别分组啦");
       List<Map> genderList= reportService.getSexData();
        return Result.success(genderList);
    }
}
